<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>姓名案例-计算属性实现</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<div id="root">
    姓：<input name="姓" v-model:value="firstName"> <br>
    名：<input name="名" v-model:value="lastName"> <br>
    <h4>全名：{{fullName}}</h4>

</div>
<script type="text/javascript">
    Vue.config.productionTip = false

    const vm = new Vue({
        el: "#root",
        data: {
            firstName: "周",
            lastName: "围"
        },
        computed: {
            fullName() {
                return this.firstName + "-" + this.lastName
            }
        }
    })
</script>

</body>
</html>